<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ page import="bean.entity.*,bean.dal.*" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<jsp:include page="top.jsp"></jsp:include>
	<script type="text/javascript" >
		function check(){
			var clerkid=document.getElementById('clerkid').value;
			var role=document.getElementById('role').value;
			var integration=document.getElementById('integration').value;
			var tel=document.getElementById('tel').value;
			var password=document.getElementById('password').value;
			var clerkname=document.getElementById('clerkname').value;
			var location=document.getElementById('location').value;
			if(tel==""||tel==null){
				window.alert("电话不能为空！");
				document.add.tel.focus();
				return false;
			}
			if(clerkname==""||clerkname==null){
				window.alert("姓名不能为空！");
				document.add.clerkname.focus();
				return false;
			}
			if(password==""||password==null){
				window.alert("密码不能为空！");
				document.add.password.focus();
				return false;
			}
			if(location==""||location==null){
				window.alert("地址不能为空！");
				document.add.location.focus();
				return false;
			}
			if(integration==""||integration==null){
				window.alert("不能积分为空！");
				document.add.integration.focus();
				return false;
			}
			if(role==""||role==null){
				window.alert("权限不能为空！");
				document.add.role.focus();
				return false;
			}
			if(clerkid==""||clerkid==null){
				window.alert("账号不能为空！");
				document.add.clerkid.focus();
				return false;
			}
			return true;
		}
	</script>


	<%
		String msg = (String) session.getAttribute("msg");
		session.setAttribute("msg","");
	%>
    <form id="bigBox" method="POST" action="/express/servlet/ClerkLogin?modth=add" name="add" onsubmit="return check()">
        <h1>添加配送员</h1>
        <font color="red">
            <span id="message">
                <%if(msg==null){msg="";} %>
                <%=msg %>
            </span>
       </font>
        <!-- 添加配送员界面容器 -->
        <div class="inputBox">
            <!-- 配送员账号/电话 -->
            <div class="inputText">
                <span>
                    <i class="iconfont icon-phone"></i>
                    账号:
                </span>
                <input type="text" id="clerkid" name="clerkid" placeholder="ClerkID" >
            </div>
            <!-- 配送员电话 -->
            <div class="inputText">
                <span>
                    <i class="iconfont icon-shouye"></i>
                    电话:
                </span>
                <input type="text" id="tel" name="tel" placeholder="Clerkphone" >
            </div>
            <!-- 配送员姓名 -->
            <div class="inputText">
                <span>
                    <i class="iconfont icon-user"></i>
                    姓名:
                </span>
                <input type="text" id="clerkname" name="clerkname" placeholder="Clerkname">
            </div>
            <!-- 密码 -->
            <div class="inputText">
                <span>
                    <i class="iconfont icon-password"></i>
                    密码:
                </span>
                <input type="text" id="password" name="password" placeholder="Password"  >
            </div>
            <!-- 配送员地址 -->
            <div class="inputText">
                <span>
                    <i class="iconfont icon-address"></i>
                    地址:
                </span>
                <input type="text" id="location" name="location" placeholder="Address"  >
            </div>
            <!-- 配送员积分 -->
            <div class="inputText">
                <span>
                    <i class="iconfont icon-jifen"></i>
                    积分:
                </span>
                <input type="text" id="integration" name="integration" placeholder="Credit" >
            </div>
            <!-- 配送员权限 -->
            <div class="inputText">
                <span>
                    <i class="iconfont icon-zhanghaoquanxianguanli"></i>
                    权限:
                </span>
                <input type="text" id="role" name="role" value="clerk" placeholder="Role" readonly="readonly" >
            </div>
            <!-- 添加按钮 -->
            <input type="submit" class="inputButton" value="添加">
            <!-- 返回按钮 -->
            <a href="admin/clerk.jsp">
                <input type="button" class="inputButton" value="返回" >
            </a>
        </div>
    </form>
  </body>
</html>
